1 #==============================================================================
2 # CMake toplevel build file for Saphira
4 # Author: Andreas Kühntopf <andreas@kuehntopf.org>
6 # Description: This file handles the Saphira build process
7 # It defines the Project, adds definitions
8 # and checks for missing dependencies.
10 #==============================================================================
13 #==============================================================================
14 # Import modules needed by this script
15 #==============================================================================
16 SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
17 INCLUDE(FindPkgConfig)
21 #==============================================================================
23 #==============================================================================
26 # Set defines which can be used in the code
28 SET(APPNAME "saphira")
30 ADD_DEFINITIONS(-DVERSION="\\"${VERSION}\\"")
31 ADD_DEFINITIONS(-DAPPNAME="\\"${APPNAME}\\"")
34 #==============================================================================
36 #==============================================================================
37 # Need to unset the __pkg_config variables,
38 # so that it keeps checking on executing cmake .
39 # Otherwise it might generate the Makefile despite
40 # the missing dependencies.
42 SET (__pkg_config_checked_GLIB-2.0 "0")
43 pkg_check_modules(GLIB-2.0 REQUIRED glib-2.0)
44 INCLUDE_DIRECTORIES(${GLIB-2.0_INCLUDE_DIRS})
45 LINK_LIBRARIES(${GLIB-2.0_LIBRARIES})
47 SET (__pkg_config_checked_GTK2 "0")
48 pkg_check_modules(GTK2 REQUIRED gtk+-2.0>=2.10)
49 INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
50 LINK_LIBRARIES(${GTK2_LIBRARIES})
52 SET (__pkg_config_checked_LIBGLADE-2.0 "0")
53 pkg_check_modules(LIBGLADE-2.0 REQUIRED libglade-2.0)
54 INCLUDE_DIRECTORIES(${LIBGLADE-2.0_INCLUDE_DIRS})
55 LINK_LIBRARIES(${LIBGLADE-2.0_LIBRARIES})
57 SET (__pkg_config_checked_LIBBURN "0")
58 pkg_check_modules(LIBBURN REQUIRED libburn-5)
59 INCLUDE_DIRECTORIES(${LIBBURN_INCLUDE_DIRS})
60 LINK_LIBRARIES(${LIBBURN_LIBRARIES})
62 SET (__pkg_config_checked_LIBISOFS "0")
63 pkg_check_modules(LIBISOFS REQUIRED libisofs-5)
64 INCLUDE_DIRECTORIES(${LIBISOFS_INCLUDE_DIRS})
65 LINK_LIBRARIES(${LIBISOFS_LIBRARIES})
67 SET (__pkg_config_checked_LIBXML-2.0 "0")
68 pkg_check_modules(LIBXML-2.0 REQUIRED libxml-2.0)
69 INCLUDE_DIRECTORIES(${LIBXML-2.0_INCLUDE_DIRS})
70 LINK_LIBRARIES(${LIBXML-2.0_LIBRARIES})
72 SET (__pkg_config_checked_GSTREAMER-0.10 "0")
73 pkg_check_modules(GSTREAMER-0.10 REQUIRED gstreamer-0.10)
74 INCLUDE_DIRECTORIES(${GSTREAMER-0.10_INCLUDE_DIRS})
75 LINK_LIBRARIES(${GSTREAMER-0.10_LIBRARIES})
78 #==============================================================================
80 #==============================================================================
81 # Default installation prefix is /usr
82 SET(CMAKE_INSTALL_PREFIX /usr)
85 #==============================================================================
86 # Which subdirectories should also be processed?
87 #==============================================================================
88 ADD_SUBDIRECTORY(src build)